package cn.tedu.hospital.base.exception;

import cn.tedu.hospital.base.response.JsonResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@Slf4j
@RestControllerAdvice
public class GlobalExceptionHandler {
    @ExceptionHandler
    public JsonResult serviceHandleException(ServiceException e) {
        log.error("服务器发生异常:", e);
        return new JsonResult(e.getStatusCode());
    }
}
